/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('viapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AiStoreApiNode {
  apis?: [
    AiStoreUserTask
  ](name='Apis'),
  product?: string(name='Product'),
  productDesc?: string(name='ProductDesc'),
}

model AiStoreReceiveConfig {
  custom?: string(name='Custom'),
  dingTalk?: {
    address?: string(name='Address'),
    secret?: string(name='Secret'),
  }(name='DingTalk'),
  eventBridge?: {
    eventBus?: string(name='EventBus'),
    eventRule?: string(name='EventRule'),
  }(name='EventBridge'),
  http?: {
    url?: string(name='Url'),
  }(name='Http'),
  https?: {
    url?: string(name='Url'),
  }(name='Https'),
  mns?: {
    queue?: string(name='Queue'),
  }(name='Mns'),
  rocketMQ?: {
    instanceId?: string(name='InstanceId'),
    topicName?: string(name='TopicName'),
  }(name='RocketMQ'),
}

model AiStoreTemplate {
  templateContext?: string(name='TemplateContext'),
  templateVariable?: string(name='TemplateVariable'),
}

model AiStoreUserTask {
  apiDesc?: string(name='ApiDesc'),
  apiName?: string(name='ApiName'),
  bucketKeyPrefix?: string(name='BucketKeyPrefix'),
  bucketName?: string(name='BucketName'),
  disableTime?: string(name='DisableTime'),
  enableTime?: string(name='EnableTime'),
  gmtCreate?: string(name='GmtCreate'),
  gmtModified?: string(name='GmtModified'),
  id?: long(name='Id'),
  name?: string(name='Name'),
  paramInfo?: string(name='ParamInfo'),
  product?: string(name='Product'),
  productDesc?: string(name='ProductDesc'),
  receiveConfig?: string(name='ReceiveConfig'),
  region?: string(name='Region'),
  regionDesc?: string(name='RegionDesc'),
  remark?: string(name='Remark'),
  status?: string(name='Status'),
  taskVersion?: string(name='TaskVersion'),
  version?: string(name='Version'),
}

model CheckServiceLinkedRoleForDeletingRequest {
  accountId?: string(name='AccountId'),
  deletionTaskId?: string(name='DeletionTaskId'),
  roleArn?: string(name='RoleArn'),
  SPIRegionId?: string(name='SPIRegionId'),
  serviceName?: string(name='ServiceName'),
}

model CheckServiceLinkedRoleForDeletingResponseBody = {
  deletable?: boolean(name='Deletable'),
  requestId?: string(name='RequestId'),
  roleUsages?: [ 
    {
      region?: string(name='Region'),
      resources?: [ bytes ](name='Resources'),
    }
  ](name='RoleUsages'),
}

model CheckServiceLinkedRoleForDeletingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckServiceLinkedRoleForDeletingResponseBody(name='body'),
}

async function checkServiceLinkedRoleForDeletingWithOptions(request: CheckServiceLinkedRoleForDeletingRequest, runtime: Util.RuntimeOptions): CheckServiceLinkedRoleForDeletingResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.deletionTaskId)) {
    query['DeletionTaskId'] = request.deletionTaskId;
  }
  if (!Util.isUnset(request.roleArn)) {
    query['RoleArn'] = request.roleArn;
  }
  if (!Util.isUnset(request.SPIRegionId)) {
    query['SPIRegionId'] = request.SPIRegionId;
  }
  if (!Util.isUnset(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckServiceLinkedRoleForDeleting',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkServiceLinkedRoleForDeleting(request: CheckServiceLinkedRoleForDeletingRequest): CheckServiceLinkedRoleForDeletingResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkServiceLinkedRoleForDeletingWithOptions(request, runtime);
}

model CreateAiStoreBucketRequest {
  bucketName?: string(name='BucketName'),
}

model CreateAiStoreBucketResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
}

model CreateAiStoreBucketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAiStoreBucketResponseBody(name='body'),
}

async function createAiStoreBucketWithOptions(request: CreateAiStoreBucketRequest, runtime: Util.RuntimeOptions): CreateAiStoreBucketResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bucketName)) {
    body['BucketName'] = request.bucketName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAiStoreBucket',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAiStoreBucket(request: CreateAiStoreBucketRequest): CreateAiStoreBucketResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAiStoreBucketWithOptions(request, runtime);
}

model CreateAiStoreReceiveConfigRequest {
  apiName?: string(name='ApiName'),
  product?: string(name='Product'),
}

model CreateAiStoreReceiveConfigResponseBody = {
  data?: AiStoreReceiveConfig(name='Data'),
  requestId?: string(name='RequestId'),
}

model CreateAiStoreReceiveConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAiStoreReceiveConfigResponseBody(name='body'),
}

async function createAiStoreReceiveConfigWithOptions(request: CreateAiStoreReceiveConfigRequest, runtime: Util.RuntimeOptions): CreateAiStoreReceiveConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiName)) {
    body['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAiStoreReceiveConfig',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAiStoreReceiveConfig(request: CreateAiStoreReceiveConfigRequest): CreateAiStoreReceiveConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAiStoreReceiveConfigWithOptions(request, runtime);
}

model CreateAiStoreUserTaskRequest {
  apiName?: string(name='ApiName'),
  bucketKeyPrefix?: string(name='BucketKeyPrefix'),
  bucketName?: string(name='BucketName'),
  createConfig?: string(name='CreateConfig'),
  name?: string(name='Name'),
  paramInfo?: string(name='ParamInfo'),
  product?: string(name='Product'),
  receiveConfig?: string(name='ReceiveConfig'),
  remark?: string(name='Remark'),
  status?: string(name='Status'),
}

model CreateAiStoreUserTaskResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
}

model CreateAiStoreUserTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAiStoreUserTaskResponseBody(name='body'),
}

async function createAiStoreUserTaskWithOptions(request: CreateAiStoreUserTaskRequest, runtime: Util.RuntimeOptions): CreateAiStoreUserTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiName)) {
    body['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.bucketKeyPrefix)) {
    body['BucketKeyPrefix'] = request.bucketKeyPrefix;
  }
  if (!Util.isUnset(request.bucketName)) {
    body['BucketName'] = request.bucketName;
  }
  if (!Util.isUnset(request.createConfig)) {
    body['CreateConfig'] = request.createConfig;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.paramInfo)) {
    body['ParamInfo'] = request.paramInfo;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.receiveConfig)) {
    body['ReceiveConfig'] = request.receiveConfig;
  }
  if (!Util.isUnset(request.remark)) {
    body['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAiStoreUserTask',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAiStoreUserTask(request: CreateAiStoreUserTaskRequest): CreateAiStoreUserTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAiStoreUserTaskWithOptions(request, runtime);
}

model DeleteAiStoreUserTaskRequest {
  aistoreVersion?: string(name='AistoreVersion'),
  id?: long(name='Id'),
}

model DeleteAiStoreUserTaskResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model DeleteAiStoreUserTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAiStoreUserTaskResponseBody(name='body'),
}

async function deleteAiStoreUserTaskWithOptions(request: DeleteAiStoreUserTaskRequest, runtime: Util.RuntimeOptions): DeleteAiStoreUserTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aistoreVersion)) {
    body['AistoreVersion'] = request.aistoreVersion;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAiStoreUserTask',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAiStoreUserTask(request: DeleteAiStoreUserTaskRequest): DeleteAiStoreUserTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAiStoreUserTaskWithOptions(request, runtime);
}

model DisableAiStoreUserTaskRequest {
  aistoreVersion?: string(name='AistoreVersion'),
  id?: long(name='Id'),
}

model DisableAiStoreUserTaskResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model DisableAiStoreUserTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableAiStoreUserTaskResponseBody(name='body'),
}

async function disableAiStoreUserTaskWithOptions(request: DisableAiStoreUserTaskRequest, runtime: Util.RuntimeOptions): DisableAiStoreUserTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aistoreVersion)) {
    body['AistoreVersion'] = request.aistoreVersion;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableAiStoreUserTask',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableAiStoreUserTask(request: DisableAiStoreUserTaskRequest): DisableAiStoreUserTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableAiStoreUserTaskWithOptions(request, runtime);
}

model EnableAiStoreUserTaskRequest {
  aistoreVersion?: string(name='AistoreVersion'),
  id?: long(name='Id'),
}

model EnableAiStoreUserTaskResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
}

model EnableAiStoreUserTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableAiStoreUserTaskResponseBody(name='body'),
}

async function enableAiStoreUserTaskWithOptions(request: EnableAiStoreUserTaskRequest, runtime: Util.RuntimeOptions): EnableAiStoreUserTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aistoreVersion)) {
    body['AistoreVersion'] = request.aistoreVersion;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableAiStoreUserTask',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableAiStoreUserTask(request: EnableAiStoreUserTaskRequest): EnableAiStoreUserTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableAiStoreUserTaskWithOptions(request, runtime);
}

model GetAiStoreReceiveConfigRequest {
  apiName?: string(name='ApiName'),
  product?: string(name='Product'),
}

model GetAiStoreReceiveConfigResponseBody = {
  data?: AiStoreReceiveConfig(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetAiStoreReceiveConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiStoreReceiveConfigResponseBody(name='body'),
}

async function getAiStoreReceiveConfigWithOptions(request: GetAiStoreReceiveConfigRequest, runtime: Util.RuntimeOptions): GetAiStoreReceiveConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiName)) {
    body['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetAiStoreReceiveConfig',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAiStoreReceiveConfig(request: GetAiStoreReceiveConfigRequest): GetAiStoreReceiveConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiStoreReceiveConfigWithOptions(request, runtime);
}

model GetAiStoreUserTaskRequest {
  id?: long(name='Id'),
}

model GetAiStoreUserTaskResponseBody = {
  data?: AiStoreUserTask(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetAiStoreUserTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiStoreUserTaskResponseBody(name='body'),
}

async function getAiStoreUserTaskWithOptions(request: GetAiStoreUserTaskRequest, runtime: Util.RuntimeOptions): GetAiStoreUserTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetAiStoreUserTask',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAiStoreUserTask(request: GetAiStoreUserTaskRequest): GetAiStoreUserTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiStoreUserTaskWithOptions(request, runtime);
}

model GetAiStoreUserTaskByNameRequest {
  name?: string(name='Name'),
}

model GetAiStoreUserTaskByNameResponseBody = {
  data?: AiStoreUserTask(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetAiStoreUserTaskByNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiStoreUserTaskByNameResponseBody(name='body'),
}

async function getAiStoreUserTaskByNameWithOptions(request: GetAiStoreUserTaskByNameRequest, runtime: Util.RuntimeOptions): GetAiStoreUserTaskByNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetAiStoreUserTaskByName',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAiStoreUserTaskByName(request: GetAiStoreUserTaskByNameRequest): GetAiStoreUserTaskByNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiStoreUserTaskByNameWithOptions(request, runtime);
}

model ListAiStoreBucketsRequest {
  apiName?: string(name='ApiName'),
  product?: string(name='Product'),
}

model ListAiStoreBucketsResponseBody = {
  data?: [ string ](name='Data'),
  requestId?: string(name='RequestId'),
}

model ListAiStoreBucketsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAiStoreBucketsResponseBody(name='body'),
}

async function listAiStoreBucketsWithOptions(request: ListAiStoreBucketsRequest, runtime: Util.RuntimeOptions): ListAiStoreBucketsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiName)) {
    body['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListAiStoreBuckets',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAiStoreBuckets(request: ListAiStoreBucketsRequest): ListAiStoreBucketsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAiStoreBucketsWithOptions(request, runtime);
}

model QueryAiStoreApiTreeResponseBody = {
  data?: [
    AiStoreApiNode
  ](name='Data'),
  requestId?: string(name='RequestId'),
}

model QueryAiStoreApiTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAiStoreApiTreeResponseBody(name='body'),
}

async function queryAiStoreApiTreeWithOptions(runtime: Util.RuntimeOptions): QueryAiStoreApiTreeResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'QueryAiStoreApiTree',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAiStoreApiTree(): QueryAiStoreApiTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAiStoreApiTreeWithOptions(runtime);
}

model QueryAiStoreRegionsResponseBody = {
  data?: [
    AiStoreUserTask
  ](name='Data'),
  requestId?: string(name='RequestId'),
}

model QueryAiStoreRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAiStoreRegionsResponseBody(name='body'),
}

async function queryAiStoreRegionsWithOptions(runtime: Util.RuntimeOptions): QueryAiStoreRegionsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'QueryAiStoreRegions',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAiStoreRegions(): QueryAiStoreRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAiStoreRegionsWithOptions(runtime);
}

model QueryAiStoreUserTaskPageRequest {
  apiName?: string(name='ApiName'),
  bucketName?: string(name='BucketName'),
  name?: string(name='Name'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  product?: string(name='Product'),
  status?: string(name='Status'),
}

model QueryAiStoreUserTaskPageResponseBody = {
  data?: {
    taskList?: [
      AiStoreUserTask
    ](name='TaskList'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
}

model QueryAiStoreUserTaskPageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAiStoreUserTaskPageResponseBody(name='body'),
}

async function queryAiStoreUserTaskPageWithOptions(request: QueryAiStoreUserTaskPageRequest, runtime: Util.RuntimeOptions): QueryAiStoreUserTaskPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.bucketName)) {
    query['BucketName'] = request.bucketName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAiStoreUserTaskPage',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAiStoreUserTaskPage(request: QueryAiStoreUserTaskPageRequest): QueryAiStoreUserTaskPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAiStoreUserTaskPageWithOptions(request, runtime);
}

model UpdateAiStoreUserTaskRequest {
  apiName?: string(name='ApiName'),
  bucketKeyPrefix?: string(name='BucketKeyPrefix'),
  bucketName?: string(name='BucketName'),
  id?: long(name='Id'),
  name?: string(name='Name'),
  paramInfo?: string(name='ParamInfo'),
  product?: string(name='Product'),
  receiveConfig?: string(name='ReceiveConfig'),
  remark?: string(name='Remark'),
  status?: string(name='Status'),
}

model UpdateAiStoreUserTaskResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model UpdateAiStoreUserTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAiStoreUserTaskResponseBody(name='body'),
}

async function updateAiStoreUserTaskWithOptions(request: UpdateAiStoreUserTaskRequest, runtime: Util.RuntimeOptions): UpdateAiStoreUserTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiName)) {
    body['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.bucketKeyPrefix)) {
    body['BucketKeyPrefix'] = request.bucketKeyPrefix;
  }
  if (!Util.isUnset(request.bucketName)) {
    body['BucketName'] = request.bucketName;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.paramInfo)) {
    body['ParamInfo'] = request.paramInfo;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.receiveConfig)) {
    body['ReceiveConfig'] = request.receiveConfig;
  }
  if (!Util.isUnset(request.remark)) {
    body['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAiStoreUserTask',
    version = '2021-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAiStoreUserTask(request: UpdateAiStoreUserTaskRequest): UpdateAiStoreUserTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAiStoreUserTaskWithOptions(request, runtime);
}

